  /**
 * Created by vision on 16/2/29.
 */
module.exports = function($rootScope,$scope,$state, USER_ROLES, loginService,publicService){
    var browser=publicService.is_weixn();
    if(browser==false){
        window.location.href="https://open.weixin.qq.com/connect/oauth2/authorize?appid=1&redirect_uri=1&response_type=code&scope=snsapi_base&state=1&connect_redirect=1#wechat_redirect";

    }
    //  存在登陆请求返回的用户ID和角色
    $scope.currentUser = null;
    //  将用户角色USER_ROLES赋值给userRoles
    $scope.userRoles = USER_ROLES;
    //  用户ID与用户角色是否全部存在   存在ture  不存在false
    $scope.isAuthorized = loginService.isAuthorized;

    $scope.setCurrentUser = function (user) {
        $scope.currentUser = user;
    };

    $scope.toUserInfo = function (){
        $state.go("userInfo");
    };

    //页面加载过程信息提示框
  /*  $rootScope.fadeShow=false;*/
 /*   $rootScope.fadeShow1=false;
    $rootScope.loadingShow=false;
    $rootScope.loadingErrShow=false;*/
};
